import React, { Fragment } from 'react';
import { Comment, List } from "antd";

interface PropsType {
    data: Array<{
        author: string;
        avatar: string;
        content: string;
        createDate: string;
    }>
}

export const ProductComments: React.FC<PropsType> = (props) => {
    const { data } = props;
    return (
        <Fragment>
            <List
                dataSource={data}
                itemLayout={"horizontal"}
                renderItem={item => {
                    return (
                        <li>
                            <Comment content={item.content} author={item.author} avatar={item.avatar} datetime={item.createDate} />
                        </li>
                    )
                }}
            >

            </List>
        </Fragment>
    )
}